#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    int n = 0;
    char arr[13];
    int len = sizeof(arr) / sizeof(arr[0]);
    int lens = len;
    int flag = 1;
    scanf("%d", &n);
    while (n)
    {
        int count = 0;
        while (count < 3)
        {
            if (n != 0)
            {
                arr[lens - 1] = n % 10 + '0';
                n /= 10;
                count++;
                lens--;
            }
            else
            {
                count++;
            }
           
            
        }
        if (n != 0)
        {
            arr[lens - 1] = ',';
            lens--;
        }
    }
    for (int i = lens; i <= len - 1; i++)
    {
        printf("%c", arr[i]);
    }
        return 0;
}
